package chan.project.smartlawmodel.vo;

import chan.project.smartlawmodel.entity.LawyerInfo;
import cn.hutool.json.JSONUtil;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 律师视图
 *
 * @author <a href="https://github.com/kavansp">kavansp</a>
 * @from <a href="https://www.code-nav.cn">编程导航学习圈</a>
 */
@Data
public class LawyerInfoVO implements Serializable {

    /**
     * 姓名
     */
    private String name;

    /**
     * 所属律所
     */
    private String lawFirm;

    /**
     * 擅长领域
     */
    private String speciallyArea;

    /**
     * 自我介绍
     */
    private String introduction;

    /**
     * 创建用户信息
     */
    private UserInfoVO user;

    /**
     * 封装类转对象
     *
     * @param lawyerInfoVO
     * @return
     */
    public static LawyerInfo voToObj(LawyerInfoVO lawyerInfoVO) {
        if (lawyerInfoVO == null) {
            return null;
        }
        LawyerInfo lawyerInfo = new LawyerInfo();
        BeanUtils.copyProperties(lawyerInfoVO, lawyerInfo);
        return lawyerInfo;
    }

    /**
     * 对象转封装类
     *
     * @param lawyerInfo
     * @return
     */
    public static LawyerInfoVO objToVo(LawyerInfo lawyerInfo) {
        if (lawyerInfo == null) {
            return null;
        }
        LawyerInfoVO lawyerInfoVO = new LawyerInfoVO();
        BeanUtils.copyProperties(lawyerInfo, lawyerInfoVO);
        return lawyerInfoVO;
    }
}
